<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ajax测试1</title>
</head>
<body>
<script>

    function createXmlReq() {
        return new XMLHttpRequest();

    }
    function getAtxt(){
        xmlreq=createXmlReq();
        xmlreq.open("get","/newsweb/a",true);
        xmlreq.send();
        xmlreq.onreadystatechange=function (){
            if(xmlreq.readyState== 4 && xmlreq.status=="200"){

            }else{
                console.log("稍等："+xmlreq.readyState)
            }
        }
    }

</script>
<button onclick="getAtxt()">来</button>
</body>
</html>